﻿using System.IO;
using System.ServiceModel.Channels;
using System.Xml;
using WCFSeviceLibrary;

namespace WCFSeviceLibrary
{
    public class AccessPolicyService : IAccessPolicyService
    {
        #region IAccessPolicyService Members

        public Message ProvidePolicyFile()
        {
            FileStream filestream = File.Open(@"ClientAccessPolicy.xml", FileMode.Open);
            // Either specify ClientAcessPolicy.xml file path properly
            // or put that in \Bin
            XmlReader reader = XmlReader.Create(filestream);
            Message result = Message.CreateMessage(MessageVersion.None, "", reader);
            return result;
        }

        #endregion
    }
}

